package com.sky.context;

public class BaseContext {
    /**
     * 线程局部变量：将变量拷贝副本给一个线程中
     */
    public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    /**
     * @param id
     */
    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }

    public static Long getCurrentId() {
        return threadLocal.get();
    }

    public static void removeCurrentId() {
        threadLocal.remove();
    }

}
